From 176e85ffe5d8cb73d9535acc62b4d00568006872 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 29 Jan 2016 19:12:51 -0500 Subject: [PATCH] file chooser: Make Escape close the dialog In some situations (no header bar, save mode), hitting Escape would not do anything because the entry ate the key event. Fix this by telling the entry to only handle Escape when there is something to do, such as switching back to the path bar. https://bugzilla.gnome.org/show_bug.cgi?id=761026 --- gtk/gtkfilechooserwidget.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 606cc248e3..127e18b474 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -2609,7 +2609,12 @@ location_entry_create (GtkFileChooserWidget *impl) if (!priv->location_entry) { - priv->location_entry = _gtk_file_chooser_entry_new (TRUE, TRUE); + gboolean eat_escape; + + eat_escape = priv->action == GTK_FILE_CHOOSER_ACTION_OPEN || + priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER; + + priv->location_entry = _gtk_file_chooser_entry_new (TRUE, eat_escape); location_entry_setup (impl); } } -- 2.30.2